//
//  YNSMineInfoController.m
//  HNBaseProject
//
//  Created by xujie on 2024/6/18.
//

#import "YNSMineInfoController.h"

@interface YNSMineInfoController ()<MxNavigationViewDelegate>
@property (nonatomic, strong) MxPublicNav *nav;
@end

@implementation YNSMineInfoController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = UIColor.whiteColor;
    [self createUI];
}

- (void)createUI {
    
    self.nav = [[MxPublicNav alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kNavBarHeight)];
    self.nav.titleLab.text = @"个人信息";
    self.nav.delegate = self;
    self.nav.line.hidden = NO;
    [self.view addSubview:self.nav];
    
    UILabel *iconTitle = [[UILabel alloc] initWithFrame:CGRectMake(15, kNavBarHeight+19, 100, 22)];
    [self.view addSubview:iconTitle];
    iconTitle.text = @"头像";
    iconTitle.font = PFRFont(16);
    iconTitle.textColor = [UIColor colorWithHexString:@"#11182F"];
    
    UIImageView *headIconV = [[UIImageView alloc] init];
    headIconV.contentMode = UIViewContentModeScaleAspectFill;
    headIconV.backgroundColor = UIColor.systemPinkColor;
    headIconV.layer.cornerRadius = 8;
    headIconV.layer.masksToBounds = YES;
    [self.view addSubview:headIconV];
    
    [headIconV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-15);
        make.height.width.mas_equalTo(48);
        make.top.offset(6+kNavBarHeight);
    }];

    UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, kNavBarHeight +60, kScreenW, 0.5)];
    line.backgroundColor = [UIColor colorWithHexString:@"#F5F5F5"];
    [self.view addSubview:line];
    
    
    UILabel *nickTitle = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(line.frame)+19, 100, 22)];
    [self.view addSubview:nickTitle];
    nickTitle.text = @"昵称";
    nickTitle.font = PFRFont(16);
    nickTitle.textColor = [UIColor colorWithHexString:@"#11182F"];
    
    UILabel *nameLab = [[UILabel alloc] init];
    [self.view addSubview:nameLab];
    nameLab.text = @"橙子";
    nameLab.font = PFRFont(16);
    nameLab.textColor = [UIColor colorWithHexString:@"#595958"];
    [self.view addSubview:nameLab];
    [nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-15);
        make.centerY.mas_equalTo(nickTitle);
    }];
    
    
    UILabel *phoneTitle = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(nickTitle.frame)+38, 150, 22)];
    [self.view addSubview:phoneTitle];
    phoneTitle.text = @"手机号码";
    phoneTitle.font = PFRFont(16);
    phoneTitle.textColor = [UIColor colorWithHexString:@"#11182F"];
    
    UILabel *phoneLab = [[UILabel alloc] init];
    [self.view addSubview:phoneLab];
    phoneLab.text = @"17755652713";
    phoneLab.font = PFRFont(16);
    phoneLab.textColor = [UIColor colorWithHexString:@"#595958"];
    [self.view addSubview:phoneLab];
    [phoneLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-15);
        make.centerY.mas_equalTo(phoneTitle);
    }];
    
    UIView *linePhone = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(phoneTitle.frame)+19, kScreenW, 0.5)];
    linePhone.backgroundColor = [UIColor colorWithHexString:@"#F5F5F5"];
    [self.view addSubview:linePhone];
    
    UIView *outLine = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(linePhone.frame)+150, kScreenW, 0.5)];
    outLine.backgroundColor = [UIColor colorWithHexString:@"#F5F5F5"];
    [self.view addSubview:outLine];
    
    MJWeakSelf
    UILabel *outLab = [[UILabel alloc] init];
    outLab.text = @"退出登录";
    outLab.textColor = [UIColor colorWithHexString:@"#106CFA"];
    outLab.font = PFRFont(16);
    outLab.userInteractionEnabled = YES;
    [self.view addSubview:outLab];
    [outLab addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id  _Nonnull sender) {
        [weakSelf logOut];
    }]];
    
    [outLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view);
        make.bottom.mas_equalTo(outLine.mas_top).offset(-19);
    }];
}

- (void)logOut {
    
}

-(void)leftTap {
    [self.navigationController popViewControllerAnimated:YES];
}

@end
